package com.ncp.servlet.comment;
/**
 * 评论提交的servlet
 */
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ncp.model.biz.comment.CommentCl;
import com.ncp.model.biz.util.Character;

public class CommentServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		byte onname=1;
		int sco=0;
		String score=request.getParameter("score");
		if(score!=null){
			sco=Integer.parseInt(score);
		}
		//System.out.println();
		String isname=request.getParameter("noname");
		int pid=Integer.parseInt(request.getParameter("id"));
		String content=request.getParameter("content");
		if(content==null){
			content="";
		}
		System.out.println(content);
		
		/*String username=(String)request.getSession().getAttribute("name");
		if(isname!=null){
			onname=Byte.parseByte(isname);
		}
		
		CommentCl cc=new CommentCl();
		if(cc.saveComment(pid, username, onname, content, sco)){
			response.sendRedirect("product.jsp");
		}*/
		
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doGet(request, response);
	}

}
